<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>style的绑定</h2>
      <!-- 允许我们写成对象 -->
      <!-- 对象的key表示的是css的属性，value表示的是属性值 -->
      <!-- 属性如果有连字符的，需要加上引号 -->
      <p :style="{ color: color, 'font-size': size + 'px', transition: a }">
        hello vue!
      </p>
      <button v-on:click="size++">btn</button>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      createApp({
        data() {
          return {
            color: "blue",
            size: 30,
            a: "all 1s",
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
